<section id="unit-floor">
  <div id="contract-detail">
    <div class="clearfix bg-f7f7f7 border-b relative" style="border-radius: 0px 6px 0px 0px;">
      <div class="pull-left contract-tab">
        <button v-for="(item, i) in unitNav" :class="[unitCurrent == item ? 'active' : '']" @click="menuTab(item)" >{{item}}</button>
      </div>
			<button type="button" @click="addEditDetail" class="btn s-btn-default absolute" style="right: 24px; top: 10px;" v-if="unitCurrent == '附加信息' && permissions.indexOf('c267') > -1">保存</button>
    </div>
  </div>
  <div v-if="unitCurrent == '单元详情' ">
  <div class="plr-24">
    <div class="basis-info border-b pb-10">
      <div class="clearfix">
        <h3 class="pull-left font-14 color-999">基础信息</h3>
        <button class="pull-right btn s-btn-default mt-10" v-if="!basisFlag && permissions.indexOf('c90') > -1" @click="basisInfoo">编辑</button>
        <button class="pull-right btn s-btn-default mt-10" v-if="basisFlag" @click="putbaseinfo">保存</button>
      </div>
      <div class="project mb-10">
        项目：<span class="color-999">{{unitData.projectName || '--'}}</span>
      </div>
      <div class="dy-flex line-height-34 mb-10">
        <div class="dy-fx-1">楼栋：
          <span class="color-999">{{unitData.buildingName || '--'}}</span></div>
        <div class="dy-fx-1">楼层：
          <span class="color-999">{{unitData.floorNum || '--'}}</span></div>
        <div class="dy-fx-1">单元名称：
          <span class="color-999">{{unitData.unitName}}</span></div>
      </div>
      <div class="dy-flex line-height-34 mb-10">
        <div class="dy-fx-1">单元类型：
          <span class="color-999">{{unitData.unitType | businessTypev}}</span></div>
        <div class="dy-fx-1">单元底价：
          <span class="color-999">{{unitData.basePrice | tofixed2}}</span>{{unitData.basePriceType ? (unitData.basePriceType == 'M' ? '元/平米/月' : '元/平米/天') : '元/平米/天'}}</div>
        <div class="dy-fx-1">价格：
          <span class="color-999" v-if="!basisFlag">{{unitData.sellPrice | tofixed2}}</span>
					<input type="text" v-if="basisFlag" style="width:80px;" class="form-control color-666 inline" v-model="unitData.sellPrice" @blur="valxy(unitData.sellPrice, 'sellPrice')">
          <span class="color-999" v-if="!basisFlag">{{unitData.sellPriceUnits}}</span>
					<input type="text" v-if="basisFlag" style="width:80px;" class="form-control color-666 inline" v-model="unitData.sellPriceUnits" placeholder="单位">
        </div>
      </div>
      <div class="dy-flex line-height-34 mb-10">
        <div class="dy-fx-1">单元面积：
          <span class="color-999">{{unitData.unitAcreage | tofixed2}}</span>m²</div>
        <div class="dy-fx-1">建筑面积：
          <span class="color-999" v-if="!basisFlag">{{unitData.consAcreage | tofixed2}}</span>
          <input type="text" v-if="basisFlag" style="width:80px;" class="form-control color-666 inline" v-model="unitData.consAcreage" @blur="valxy(unitData.consAcreage, 'consAcreage')">
          m²
        </div>
        <div class="dy-fx-1">套内面积：
          <span class="color-999" v-if="!basisFlag">{{unitData.innerAcreage | tofixed2}}</span>
          <input type="text" v-if="basisFlag" style="width:80px;" class="form-control color-666 inline" v-model="unitData.innerAcreage" @blur="valxy(unitData.innerAcreage, 'innerAcreage')">
          m²
        </div>
			</div>
			<div class="dy-flex line-height-34 mb-10">
				<div class="dy-fx-1">户型：
					<span class="color-999" v-if="!basisFlag">{{unitData.houseStyle}}</span>
					<input type="text" v-if="basisFlag" style="width:80px;" class="form-control color-666 inline" v-model="unitData.houseStyle" @blur="valxy(unitData.consAcreage, 'consAcreage')">
				</div>
				<div class="dy-fx-2" style="display: flex">行政街号：
					<span class="color-999" v-if="!basisFlag" style="width: 490px">{{unitData.streetAddress}}</span>
					<input type="text" v-if="basisFlag" style="width:490px;" class="form-control color-666 inline" v-model="unitData.streetAddress" @blur="valxy(unitData.consAcreage, 'consAcreage')">
				</div>
			</div>
      <div class="dy-flex line-height-34">
        <div class="dy-fx-1">装修水平：
          <span v-if="!basisFlag">{{typeval}}</span>
          <div class="select-ul" style="width:100px;" v-if="basisFlag">
            <span class="select-name br-4 box-i-shadow">{{typeval}}</span>
            <ul>
              <li v-for="item in decoration" @click="unitData.decorationType = item.code">{{item.memo}}</li>
            </ul>
          </div>
        </div>
        <div class="dy-fx-1">朝向：
          <span v-if="!basisFlag">{{unitData.orientationType ? unitData.orientationType : '' | orientationv}}</span>
          <div class="select-ul" style="width:100px;" v-if="basisFlag">
            <span class="select-name br-4 box-i-shadow">{{unitData.orientationType ? unitData.orientationType : 'ET' | orientationv}}</span>
            <ul>
              <li v-for="item in orientationData" @click="unitData.orientationType = item.code">{{item.code | orientationv}}</li>
            </ul>
          </div>
        </div>
        <div class="dy-fx-1">临街：
          <span class="color-999" v-if="!basisFlag">{{unitData.streetType == 'Y' ? '是' : (unitData.streetType == 'N' ? '否' : '--')}}</span>
          <div class="inline" v-if="basisFlag" style="vertical-align: middle; margin-top:-3px;">
            <button
              :class="{'js-select-radio':true, 'select-active':item.code == active, 'line-height-34':true}"
              v-for="(item, index) in cmrType"
              @click="setcmrDataAtType(item.code)"
            >{{item.name}}</button>
          </div>
        </div>
      </div>
			<div class="dy-flex line-height-34 mt-10">
				<div class="dy-fx-1">装修状态：
				  <span v-if="!basisFlag">{{decorationStageVal}}</span>
				  <div class="select-ul" style="width:100px;" v-if="basisFlag">
				    <span class="select-name br-4 box-i-shadow">{{decorationStageVal}}</span>
				    <ul>
				      <li v-for="item in debishadiao" @click="unitData.decorationStage = item.dictCode">{{item.dictName}}</li>
				    </ul>
				  </div>
				</div>
				<div class="dy-fx-1"></div>
				<div class="dy-fx-1"></div>
			</div>
    </div>

    <div>
      <div class="clearfix">
        <h3 class="pull-left font-14 color-999">配套设施</h3>
        <button class="pull-right btn s-btn-default mt-10" v-if="!standard && permissions.indexOf('c90') > -1" @click="flagIs">编辑</button>
        <button class="pull-right btn s-btn-default mt-10" v-if="standard" @click="putfacilitys">保存</button>
      </div>
      <div class="border-b ptb-20">
        <ul class="standard">
          <li v-for="(item, index) in facilitysData" v-if="item.flag" :title="item.memo">
            <div :class="{'standard-inline':1, cursor:1, active:unitData.facilitys.indexOf(item.dictCode) > -1}" @click="setfacilitys(item.dictCode, index)">{{item.dictName}}</div>
          </li>
        </ul>
      </div>
    </div>

    <div>
      <div class="clearfix">
        <h3 class="pull-left font-14 color-999">图片信息</h3>
        <button class="pull-right btn s-btn-default mt-10" v-if="!picture && permissions.indexOf('c90') > -1" @click="picture = !picture">编辑</button>
        <button class="pull-right btn s-btn-default mt-10" v-if="picture" @click="putimgs">保存</button>
      </div>
      <div class="clearfix">
        <p class="pull-left" style="line-height:70px;">楼层平面落位：
          <span v-if="!unitData.unitPositionImg && !picture" class="color-999">暂无图片，请上传</span></p>
        <ul class="pull-left picture">
          <li v-if="unitData.unitPositionImg">
            <img :src="unitData.unitPositionImg+'?w=70&h=70'" @click="getBigPic(unitData.unitPositionImg, 0, 'o')" />
            <span v-if="picture" class="cursor" @click="delPic(0)">删除</span>
          </li>
          <li class="buttonUp" v-if="!unitData.unitPositionImg && picture" @click="uploadImgs(0)">+</li>
        </ul>
			</div>
      <div class="clearfix">
        <p class="pull-left" style="line-height:70px;">单元平面图：
          <span v-if="!unitData.unitPlainImg.length && !picture" class="color-999">暂无图片，请上传</span></p>
				<ul class="pull-left picture">
          <li v-for="(item, index) in unitData.unitPlainImg">
            <img :src="item+'?w=70&h=70'" @click="getBigPic(unitData.unitPlainImg, index)" />
            <span v-if="picture" class="cursor" @click="delPic(1, index)">删除</span>
          </li>
          <li class="buttonUp" v-if="unitData.unitPlainImg.length < 10 && picture" @click="uploadImgs(1)">+</li>
        </ul>
      </div>
      <div class="clearfix">
        <p class="pull-left" style="line-height:70px;">装修图：
          <span v-if="!unitData.consImgs.length && !picture" class="color-999">暂无图片，请上传</span></p>
        <ul class="pull-left picture">
          <li v-for="(item, index) in unitData.consImgs">
            <img :src="item+'?w=70&h=70'" @click="getBigPic(unitData.consImgs, index)" />
            <span v-if="picture" class="cursor" @click="delPic(2, index)">删除</span>
          </li>
          <li class="buttonUp" v-if="unitData.consImgs.length < 10 && picture" @click="uploadImgs(2)">+</li>
        </ul>
      </div>
      <div class="clearfix">
        <p class="pull-left" style="line-height:70px;">室内实拍图：
          <span v-if="!unitData.innerImgs.length && !picture" class="color-999">暂无图片，请上传</span></p>
        <ul class="pull-left picture">
          <li v-for="(item, index) in unitData.innerImgs">
            <img :src="item+'?w=70&h=70'" @click="getBigPic(unitData.innerImgs, index)" />
            <span v-if="picture" class="cursor" @click="delPic(3, index)">删除</span>
          </li>
          <li class="buttonUp cursor" v-if="unitData.innerImgs.length < 10 && picture" @click="uploadImgs(3)">+</li>
        </ul>
      </div>
    </div>
    <div class="mt-10 border-t">
      <div class="clearfix">
        <h3 class="pull-left font-14 color-999">单元简介</h3>
        <button class="pull-right btn s-btn-default mt-10" v-if="!unitMsg && permissions.indexOf('c90') > -1" @click="unitMsg = !unitMsg">编辑</button>
        <button class="pull-right btn s-btn-default mt-10" v-if="unitMsg" @click="putmemo">保存</button>
      </div>
      <div class="mt-15 mb-10">
        <textarea v-if="unitMsg" class="unitMsg form-control" v-model="unitData.memo"></textarea>
        <div v-if="!unitData.memo && !unitMsg">暂无介绍，请编辑</div>
        <div v-if="!unitMsg && unitData.memo" class="bbj">
          <div class="bbj1" style="white-space: pre-wrap; word-break:break-all;">{{unitData.memo}}</div>
        </div>
      </div>
    </div>
  </div>
  </div>
  <div v-if="unitCurrent == '相关文件' ">
    <!-- 相关文件 -->
    <div class="contract-file-container mt-15 ml-24 mr-24">
			<div class="loadprogress" v-if="progress">正在上传({{progress}})...</div>
      <div class="upload-head-contract clearfix border-b pb-10">
        <div class="pull-left font-16 line-height-34">文件列表</div>
        <button class="pull-right s-btn-default btn font-14 upload-file" v-if="permissions.indexOf('c92') > -1"  @click="uploadFile">上传文件</button>
      </div>
      <div>
        <ul>
          <li class="clearfix border-b" v-for="(item,index) in contractFile">
            <p class="icon-Nav-contract-file file-name">
              <span>{{item.name}}</span>
            </p>
						<p class="pull-right line-height-45 file-btn dy-flex opera-but" style="align-items: center;height: 45px">
							<a class="icon-Gm-delete opera-but-first" v-if="permissions.indexOf('c91') > -1"  @click="deleteFile(item.url,index)">
									<b>删除</b>
							</a>
							<span class="block-D-P-D" v-if="permissions.indexOf('c91') > -1"></span>
							<a  class="icon-GM-preview" @click="previewImage(item.url)">
									<b>预览</b>
							</a>
							<span class="block-D-P-D"></span>
							<a :href="item.url" :download="item.name" class="icon-Gm-download">
									<b>下载</b>
							</a>
						</p>
          </li>
        </ul>
      </div>
    </div>
  </div>

	<div v-if="unitCurrent == '附加信息' " class="pl-24 mt-15 pb-20" style="width: 996px;">

		<div class="clearfix line-height-34">
			<div class="dy-flex">
				<div class="dy-fx-1 dy-flex">
					<div class="dy-fx-2">建筑面积：</div>
					<div class="dy-fx-4 relative">
						<input type="text" class="form-control inline" style="width: 140px;" v-model="buildAreage" />
						<span class="absolute color-gray" style="left: 110px;top: 0;">| m²</span>
					</div>
				</div>
				<div class="dy-fx-1 dy-flex">
					<div class="dy-fx-2">套内面积：</div>
					<div class="dy-fx-4 relative">
						<input type="text" class="form-control inline" style="width: 140px;" v-model="inAreage" />
						<span class="absolute color-gray" style="left: 110px;top: 0;">| m²</span>
					</div>
				</div>
				<div class="dy-fx-1 dy-flex">
					<div class="dy-fx-2">租赁面积：</div>
					<div class="dy-fx-4 relative">
						<input type="text" class="form-control inline" style="width: 140px;" v-model="leaseAreage" />
						<span class="absolute color-gray" style="left: 110px;top: 0;">| m²</span>
					</div>
				</div>
			</div>
			<div class="dy-flex mt-10">
				<div class="dy-fx-1 dy-flex">
					<div class="dy-fx-2">业态：</div>
					<div class="dy-fx-4 relative">
						<div class="select-ul" style="width: 140px;">
							<span class="select-name br-4 box-i-shadow" ref="yt">请选择</span>
						  <ul>
						    <li v-for="item in zcestatetypeArr" @click="zcestatetype = item.dictCode">{{ item.dictName }}</li>
						  </ul>
						</div>
					</div>
				</div>
				<div class="dy-fx-1 dy-flex">
					<div class="dy-fx-2">管理单位：</div>
					<div class="dy-fx-4 relative">
						<input type="text" class="form-control inline" style="width: 140px;" v-model="adminUnit" />
						<span class="color-gray font-12">（部门）</span>
					</div>
				</div>
				<div class="dy-fx-1 dy-flex">
					<div class="dy-fx-2">管理单位：</div>
					<div class="dy-fx-4 relative">
						<input type="text" class="form-control inline" style="width: 140px;" v-model="adminUnit0" />
						<span class="absolute color-gray font-12" style="left: 145px;top: 0;white-space:nowrap;">（部门负责人）</span>
					</div>
				</div>
			</div>
			<div class="dy-flex mt-10">
				<div class="dy-fx-1 dy-flex">
					<div class="dy-fx-2">物业状态：</div>
					<div class="dy-fx-4 relative">
						<div class="select-ul" style="width: 140px;">
							<span class="select-name br-4 box-i-shadow" ref="wyzt">请选择</span>
						  <ul>
						    <li v-for="item in zcpropertytypeArr" @click="zcpropertytype = item.dictCode">{{ item.dictName }}</li>
						  </ul>
						</div>
					</div>
				</div>
				<div class="dy-fx-1 dy-flex">
					<div class="dy-fx-2">使用单位：</div>
					<div class="dy-fx-4 relative">
						<input type="text" class="form-control inline" style="width: 140px;" v-model="useUnit" />
					</div>
				</div>
				<div class="dy-fx-1 dy-flex">
					<div class="dy-fx-2 relative">
						<p class="absolute" style="white-space:nowrap;left: 0;top: 0;">使用人所属单位：</p>
					</div>
					<div class="dy-fx-4 relative">
						<input type="text" class="form-control inline" style="width: 140px;" v-model="useSoUnit" />
					</div>
				</div>
			</div>
			<div class="dy-flex mt-10">
				<div class="dy-fx-1 dy-flex">
					<div class="dy-fx-2">使用单位性质：</div>
					<div class="dy-fx-4 relative">
						<div class="select-ul" style="width: 140px;">
							<span class="select-name br-4 box-i-shadow" ref="dwxz">请选择</span>
						  <ul>
						    <li v-for="item in zcleaseholderorgtypeArr" @click="zcleaseholderorgtype = item.dictCode">{{ item.dictName }}</li>
						  </ul>
						</div>
					</div>
				</div>
				<div class="dy-fx-1 dy-flex">
					<div class="dy-fx-2">使用人数：</div>
					<div class="dy-fx-4 relative">
						<input type="text" class="form-control inline" style="width: 140px;" v-model="useNumber" />
					</div>
				</div>
				<div class="dy-fx-1 dy-flex"></div>
			</div>
		</div>
		<div class="border-t pt-10 mt-10">
			<div class="clearfix">
				<div class="pull-left clearfix line-height-34">
					<div class="pull-left" style="width: 150px;">使用结束日期：</div>
					<div class="pull-left relative" style="margin-right: 34px;">
						<web-calendar type="primary" tips="选择时间" width="140" v-model="endTime"></web-calendar>
					</div>
				</div>
				<div class="pull-left clearfix line-height-34">
					<div class="pull-left" style="width: 140px;">使用开始日期：</div>
					<div class="pull-left" style="margin-right: 34px;">
						<web-calendar type="primary" tips="选择时间" width="140" v-model="beginTime"></web-calendar>
					</div>
				</div>
				<div class="pull-left clearfix line-height-34">
					<div class="pull-left" style="width: 145px;">使用单位联系人：</div>
					<div class="pull-left">
						<input type="text" class="form-control" style="width: 140px;" v-model="unitConact" />
					</div>
				</div>
			</div>
			<div class="clearfix mt-10">
				<div class="pull-left clearfix line-height-34">
					<div class="pull-left" style="width: 150px;">使用单位联系方式：</div>
					<div class="pull-left relative" style="margin-right: 34px;">
						<input type="text" class="form-control" style="width: 140px;" v-model="unitPhone" />
					</div>
				</div>
				<div class="pull-left clearfix line-height-34">
					<div class="pull-left" style="width: 140px;">租借/投资/处置面积：</div>
					<div class="pull-left relative" style="margin-right: 34px;">
						<input type="text" class="form-control" style="width: 140px;" v-model="ztcAreage" />
						<span class="absolute color-gray" style="right: 10px;top: 0;">| m²</span>
					</div>
				</div>
				<div class="pull-left clearfix line-height-34">
					<div class="pull-left" style="width: 145px;">租借/合作单位名称：</div>
					<div class="pull-left">
						<input type="text" class="form-control" style="width: 140px;" v-model="zhUnit" />
					</div>
				</div>
			</div>
			<div class="clearfix mt-10">
				<div class="pull-left clearfix line-height-34">
					<div class="pull-left" style="width: 150px;">是否公开招租：</div>
					<div class="pull-left relative" style="margin-right: 34px;">
						<div class="select-ul" style="width: 140px;">
							<span class="select-name br-4 box-i-shadow" ref="zhaozu">请选择</span>
						  <ul>
						    <li v-for="item in isDefaultArr" @click="publicRental = item.code">{{ item.name }}</li>
						  </ul>
						</div>
					</div>
				</div>
				<div class="pull-left clearfix line-height-34">
					<div class="pull-left" style="width: 140px;">租借/投资期限：</div>
					<div class="pull-left relative" style="margin-right: 34px;">
						<input type="text" class="form-control" style="width: 140px;" v-model="term" />
					</div>
				</div>
				<div class="pull-left clearfix line-height-34">
					<div class="pull-left" style="width: 145px;">合同约定年租金/分成：</div>
					<div class="pull-left">
						<input type="text" class="form-control" style="width: 140px;" v-model="fallInto" />
					</div>
				</div>
			</div>
			<div class="clearfix mt-10">
				<div class="pull-left clearfix line-height-34">
					<div class="pull-left" style="width: 150px;">审批单位：</div>
					<div class="pull-left relative" style="margin-right: 34px;">
						<input type="text" class="form-control" style="width: 140px;" v-model="approval" />
					</div>
				</div>
			</div>
		</div>
		<div class="border-t pt-10 mt-10">
			<div class="dy-flex">
				<div class="dy-fx-1">
					<span>租借/投资/处置收入金额：</span>
					<input type="text" class="form-control inline" style="width: 140px;" v-model="inMoney" />
					<span class="color-gray font-12">（万元）</span>
				</div>
				<div class="dy-fx-1">
					<span>上缴财政金额：</span>
					<input type="text" class="form-control inline" style="width: 140px;" v-model="outMoney" />
					<span class="color-gray font-12">（万元）</span>
				</div>
			</div>
			<div class="dy-flex mt-10">
				<div class="dy-fx-1">备注：</div>
				<div class="dy-fx-9">
					<textarea class="form-control" style="width: 60%;" rows="5" v-model="memo"></textarea>
				</div>
			</div>
		</div>
	</div>
  <div class="js-trigger-upload"></div>
  <div class="js-trigger-upload1"></div>
</section>
<script src="modules/price/scripts/unit_floor.js" charset="utf-8"></script>

<style type="text/css">
	.hl-date-icon:before {
		right: 0;
		top: 0;
	}
	.hl-date-calendar {
		left: inherit;
		right: 0;
	}
	.loadprogress{
		position: fixed;
		z-index: 999999;
		left: 0;
		bottom: 0;
		height: 20px;
		width: 500px;
		font-size: 12px;
		text-indent: 3px;
		line-height: 20px;
	}
</style>
